stack = []
s = ')()('
for i in s:
    if i in '([{<':
        stack.append(i)
    else:
        if i == ')' and stack[-1] == '(':
            stack.pop()
            print()
        elif i == '}' and stack[-1] == '{':
            stack.pop()
        elif i == '>' and stack[-1] == '<':
            stack.pop()
        elif i == ']' and stack[-1] == '[':
            stack.pop()
        else:
            break
print(stack)
if len(stack) == 0:
    print('True')
else:
    print('False')
